package cn.iocoder.yudao.module.exam.dal.mysql.questionbank;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.exam.dal.dataobject.questionbank.QuestionBankDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.exam.controller.admin.questionbank.vo.*;

/**
 * 试题题库题目关联 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface QuestionBankMapper extends BaseMapperX<QuestionBankDO> {

    default PageResult<QuestionBankDO> selectPage(QuestionBankPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<QuestionBankDO>()
                .eqIfPresent(QuestionBankDO::getBankId, reqVO.getBankId())
                .eqIfPresent(QuestionBankDO::getQuestionId, reqVO.getQuestionId())
                .orderByDesc(QuestionBankDO::getId));
    }

}